<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>年龄区间</title>
</head>
<body>

<script>
    var age=window.prompt("请输入年龄")
    if(age<14){
         document.write("儿童<br>");}

         else if (14<=age<24){document.write("青年<br>")}

         else if(24<age<40){document.write("中年<br>")}

         document.write("程序执行完成！<br>");
</script>

</body>
</html>